package typechecker.ast.type;

import typechecker.ast.Context;

public class FunctionType extends TypeExpression{
	private TypeExpression src, dest;
	
	public FunctionType(TypeExpression src, TypeExpression dest) {
		this.src = src;
		this.dest = dest;
	}

	@Override
	public String preetyPrint() {
		return "(" + src.preetyPrint() + 
		" -> " + dest.preetyPrint() + ")";
	}
	
	public TypeExpression getDest() {
		return dest;
	}
	
	public TypeExpression getSrc() {
		return src;
	}
	@Override
	public TypeExpression freshCopy(Context<TypeVariable> ctx) {
		return new FunctionType(src.freshCopy(ctx), dest.freshCopy(ctx));
	}
}
